package ltd.rycloud.tms.service;

import java.util.List;

import ltd.rycloud.tms.dao.SubmitDao;
import ltd.rycloud.tms.entity.Submit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class SubmitService {
	@Autowired
	SubmitDao submitDao;
	//添加
	public Submit save(Submit submit){
		return submitDao.save(submit);
	}
	//修改
	public Submit update(Submit submit) {
		return submitDao.save(submit);
	}
	//删除
	public void delete(int id) {
		submitDao.deleteById(id);
	}
	//查看
	public List<Submit> findAll(){
		return submitDao.findAll();
	}
	//根据id
	public Submit findById(int id) {
		return submitDao.findById(id).get();
	}
	//根据busid
	public List<Submit> findByBusid(int busid){
		return submitDao.findByBusid(busid);
	}
	//根据type
	public List<Submit> findByType(int type){
		return submitDao.findByType(type);
	}
	//根据username
	public List<Submit> findByUsername(String username){
		return submitDao.findByUsername(username);
	}
	

}
